package user

import (
	"github.com/gin-gonic/gin"
	. "savor_gin/controllers/user"
	"savor_gin/middlewares/token"
)

func UserLoad(g *gin.Engine) {
	g.POST("/user/register", Register)
	g.POST("/user/login", Login)
	g.GET("/user/list", GetUserApi)
	userV1 := g.Group("/api/v1/user")
	userV1.Use(token.AuthMiddleware())
	{
		userV1.DELETE("", DeleteUserApi)
		userV1.PUT("", UpdateUserApi)
		userV1.GET("", GetUserById)
	}
}
